/*
 * Created by JFormDesigner on Mon Apr 10 15:07:18 CST 2023
 */

package com.canteen.gui.dishesform;

import java.awt.*;
import javax.swing.*;

/**
 * @author s303teacher
 */
public class DishesForm extends JFrame {
    public DishesForm() {
        initComponents();
    }

    private void initComponents() {
        // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents  @formatter:off
        dishesIdLabel = new JLabel();
        dishesIdInput = new JTextField();
        dishesNameLabel = new JLabel();
        dishesNameInput = new JTextField();
        dishesTypeLabel = new JLabel();
        dishesTypeInput = new JComboBox<>();
        dishesDetailLabel = new JLabel();
        scrollPane1 = new JScrollPane();
        dishesDetailInput = new JEditorPane();
        submitButton = new JButton();
        cancelButton = new JButton();
        dishesImageLabel = new JLabel();
        uploadImageBuuton = new JButton();
        deleteImageButton = new JButton();

        //======== this ========
        setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
        setResizable(false);
        setTitle("\u83dc\u54c1\u5f55\u5165");
        var contentPane = getContentPane();
        contentPane.setLayout(null);

        //---- dishesIdLabel ----
        dishesIdLabel.setText("\u83dc\u54c1\u53f7\uff1a");
        contentPane.add(dishesIdLabel);
        dishesIdLabel.setBounds(50, 25, 55, 30);
        contentPane.add(dishesIdInput);
        dishesIdInput.setBounds(105, 25, 145, 30);

        //---- dishesNameLabel ----
        dishesNameLabel.setText("\u83dc\u54c1\u540d\uff1a");
        contentPane.add(dishesNameLabel);
        dishesNameLabel.setBounds(50, 70, 55, 30);
        contentPane.add(dishesNameInput);
        dishesNameInput.setBounds(105, 70, 145, 30);

        //---- dishesTypeLabel ----
        dishesTypeLabel.setText("\u83dc\u54c1\u7c7b\uff1a");
        contentPane.add(dishesTypeLabel);
        dishesTypeLabel.setBounds(50, 110, 55, 30);

        //---- dishesTypeInput ----
        dishesTypeInput.setModel(new DefaultComboBoxModel<>(new String[] {
            "\u4e3b\u83dc",
            "\u914d\u83dc1",
            "\u914d\u83dc2"
        }));
        dishesTypeInput.setSelectedIndex(0);
        contentPane.add(dishesTypeInput);
        dishesTypeInput.setBounds(110, 110, 140, 30);

        //---- dishesDetailLabel ----
        dishesDetailLabel.setText("\u83dc\u54c1\u8be6\u60c5\uff1a");
        contentPane.add(dishesDetailLabel);
        dishesDetailLabel.setBounds(45, 150, 75, 35);

        //======== scrollPane1 ========
        {
            scrollPane1.setViewportView(dishesDetailInput);
        }
        contentPane.add(scrollPane1);
        scrollPane1.setBounds(50, 185, 220, 185);

        //---- submitButton ----
        submitButton.setText("\u63d0\u4ea4");
        contentPane.add(submitButton);
        submitButton.setBounds(65, 540, 85, submitButton.getPreferredSize().height);

        //---- cancelButton ----
        cancelButton.setText("\u53d6\u6d88");
        contentPane.add(cancelButton);
        cancelButton.setBounds(165, 540, 85, cancelButton.getPreferredSize().height);

        //---- dishesImageLabel ----
        dishesImageLabel.setText("\u56fe\u7247");
        contentPane.add(dishesImageLabel);
        dishesImageLabel.setBounds(50, 390, 115, 110);

        //---- uploadImageBuuton ----
        uploadImageBuuton.setText("\u4e0a\u4f20\u56fe\u7247");
        contentPane.add(uploadImageBuuton);
        uploadImageBuuton.setBounds(175, 390, 91, uploadImageBuuton.getPreferredSize().height);

        //---- deleteImageButton ----
        deleteImageButton.setText("\u5220\u9664\u56fe\u7247");
        contentPane.add(deleteImageButton);
        deleteImageButton.setBounds(175, 440, 91, 28);

        {
            // compute preferred size
            Dimension preferredSize = new Dimension();
            for(int i = 0; i < contentPane.getComponentCount(); i++) {
                Rectangle bounds = contentPane.getComponent(i).getBounds();
                preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
                preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
            }
            Insets insets = contentPane.getInsets();
            preferredSize.width += insets.right;
            preferredSize.height += insets.bottom;
            contentPane.setMinimumSize(preferredSize);
            contentPane.setPreferredSize(preferredSize);
        }
        setSize(325, 630);
        setLocationRelativeTo(getOwner());
        // JFormDesigner - End of component initialization  //GEN-END:initComponents  @formatter:on
    }

    // JFormDesigner - Variables declaration - DO NOT MODIFY  //GEN-BEGIN:variables  @formatter:off
    private JLabel dishesIdLabel;
    private JTextField dishesIdInput;
    private JLabel dishesNameLabel;
    private JTextField dishesNameInput;
    private JLabel dishesTypeLabel;
    private JComboBox<String> dishesTypeInput;
    private JLabel dishesDetailLabel;
    private JScrollPane scrollPane1;
    private JEditorPane dishesDetailInput;
    private JButton submitButton;
    private JButton cancelButton;
    private JLabel dishesImageLabel;
    private JButton uploadImageBuuton;
    private JButton deleteImageButton;
    // JFormDesigner - End of variables declaration  //GEN-END:variables  @formatter:on
}
